import * as React from 'react'
import { View, TouchableOpacity, Text } from 'react-native'

import { RefreshList, RefreshState } from './index'



const App = () => {

    const [refreshState, setRefreshState] = React.useState(RefreshState.Idle)

    const listRef = React.useRef<any>()

    return (

        <RefreshList
            mode='SectionList'
            sections={
                [
                    {
                        title: "Main dishes",
                        data: ["Pizza", "Burger", "Risotto"]
                    },
                    {
                        title: "Sides",
                        data: ["French Fries", "Onion Rings", "Fried Shrimps"]
                    },
                    {
                        title: "Drinks",
                        data: ["Water", "Coke", "Beer"]
                    },
                    {
                        title: "Desserts",
                        data: ["Cheese Cake", "Ice Cream"]
                    }
                ]
            }
            renderItem={({ item, section }) => {

                return <View>{item}</View>
            }}

            refreshState={refreshState}
            onHeaderRefresh={() => {

            }}
            onFooterRefresh={() => {

            }}

            renderSectionHeader={({ section: { letter } }) => (
                <View style={{ backgroundColor: 'red' }}>

                </View>
            )}
        />


    )
}